//
//  AppDelegate+Chat.m
//  SISSAPP
//
//  Created by 优房网 on 2017/7/5.
//  Copyright © 2017年 优房网. All rights reserved.
//

#import "AppDelegate+Chat.h"

//#import <Hyphenate/Hyphenate.h>
#import <EaseUI/EaseUI.h>

@implementation AppDelegate (Chat)

- (void)configChat {
    
#pragma mark - 环信
    //AppKey:注册的AppKey，详细见下面注释。
    //apnsCertName:推送证书名（不需要加后缀），详细见下面注释。
    EMOptions *options = [EMOptions optionsWithAppkey:IM_APPKEY];
#ifdef DEBUG
    options.apnsCertName = @"development_apns";
#else
    options.apnsCertName = @"production_apns";
#endif
    
//    production_apns development_apns
    [[EMClient sharedClient] initializeSDKWithOptions:options];
}

#pragma mark - 环信
// APP进入后台
- (void)applicationDidEnterBackground:(UIApplication *)application {
    [[EMClient sharedClient] applicationDidEnterBackground:application];
}

// APP将要从后台返回
- (void)applicationWillEnterForeground:(UIApplication *)application {
    [[EMClient sharedClient] applicationWillEnterForeground:application];
    
}

- (void)clearBadgeNumber {
    [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
}

@end
